package com.cros.pruebas;

import java.util.ArrayList;
import java.util.List;

public class Animal {

}

class Cat extends Animal{
	
}

class Bird extends Animal{

	
}

class Foo {
	public static void main(String argv[]){
		System.out.println("ok");
		Foo f = new Foo();
		Animal[] an = new Animal[10];
		an [0] = new Bird();
		an [1] = new Bird();
		f.addAnimal(an);
		System.out.println("ok!!");
		List<Bird> ani = new ArrayList<Bird>();
		ani.add(new Bird());
		ani.add(new Bird());
		f.addAnimalArrayList(ani);
		System.out.println("double ok!!");
		
		
		ArrayList<Integer> j = new ArrayList<Integer>();
		j.add(5);
	}
	
	public void addAnimal(Animal[] animals) {
		animals[2] = new Cat(); // Eeek! We just put a Dog
		// in a Cat array!
		}
	
	public void addAnimalArrayList(List<? extends Animal> ani) {
		//ani.add(new Bird());
		}
}